{% extends "base_generic.html" %}

{% block content %}
  <div class="card">
    <h1>我的借阅图书</h1>

    {% if bookinstance_list %}
      <ul class="list-group">
        {% for bookinst in bookinstance_list %}
          <li class="list-group-item {% if bookinst.is_overdue %}list-group-item-danger{% endif %}">
            <a href="{% url 'book-detail' bookinst.book.pk %}" class="btn btn-main btn-sm">{{bookinst.book.title}}</a>
            <span class="text-muted">（应归还日期: {{ bookinst.due_back }}）</span>
            {% if bookinst.is_overdue %}
              <p class="text-danger" style="margin-top: 5px; margin-bottom: 0;">已逾期！请尽快归还。</p>
            {% endif %}
          </li>
        {% endfor %}
      </ul>
    {% else %}
      <p>您当前没有借阅任何图书。</p>
    {% endif %}
  </div>
{% endblock %}
